import request from '@/utils/request'
import type { GetTravelManagResponse, GetTravelManagCommentResponse } from '@/type/travel-mange'

// 获取全部游记
export const getTravelManagAPI = (page: number): Promise<GetTravelManagResponse> => {
  return request.get('/apif/travelManaGement', { params: { page } })
}

// 获取评论数据
export const getTravelCommentAPI = (
  article_id: string,
  page: number,
): Promise<GetTravelManagCommentResponse> => {
  return request.get('/apif/comments-data', {
    params: {
      article_id,
      page,
    },
  })
}


// 删除游记
export const deleteTravelManagAPI = (_id: string): Promise<void> => {
  return request.delete(`/apif/deleteUserTravel`, { data: { _id } })
}
